package org.jeecg.modules.oms.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description: 销售概览统计VO
 * @Author: jeecg-boot
 * @Date: 2025-01-13
 * @Version: V1.0
 */
@Data
@ApiModel(value = "SalesOverviewVO", description = "销售概览统计VO")
public class SalesOverviewVO {

    @ApiModelProperty(value = "今日销售额")
    private BigDecimal todaySales;

    @ApiModelProperty(value = "本周销售额")
    private BigDecimal weekSales;

    @ApiModelProperty(value = "本月销售额")
    private BigDecimal monthSales;

    @ApiModelProperty(value = "本年销售额")
    private BigDecimal yearSales;

    @ApiModelProperty(value = "今日订单数")
    private Integer todayOrderCount;

    @ApiModelProperty(value = "本周订单数")
    private Integer weekOrderCount;

    @ApiModelProperty(value = "本月订单数")
    private Integer monthOrderCount;

    @ApiModelProperty(value = "本年订单数")
    private Integer yearOrderCount;

    @ApiModelProperty(value = "平均订单金额")
    private BigDecimal avgOrderAmount;

    @ApiModelProperty(value = "销售增长率(月同比)")
    private BigDecimal monthGrowthRate;

    @ApiModelProperty(value = "年同比增长率")
    private BigDecimal yearGrowthRate;

    @ApiModelProperty(value = "去年同月销售额")
    private BigDecimal lastYearMonthSales;

    @ApiModelProperty(value = "去年同年销售额")
    private BigDecimal lastYearYearSales;

    @ApiModelProperty(value = "去年同月订单数")
    private Integer lastYearMonthOrderCount;

    @ApiModelProperty(value = "去年同年订单数")
    private Integer lastYearYearOrderCount;

    @ApiModelProperty(value = "销售趋势数据")
    private List<SalesTrendItem> trendData;

    @ApiModelProperty(value = "订单状态分布")
    private List<OrderStatusItem> statusDistribution;

    @Data
    @ApiModel(value = "SalesTrendItem", description = "销售趋势项")
    public static class SalesTrendItem {
        @ApiModelProperty(value = "日期")
        private String date;

        @ApiModelProperty(value = "销售额")
        private BigDecimal amount;

        @ApiModelProperty(value = "订单数量")
        private Integer orderCount;
    }

    @Data
    @ApiModel(value = "OrderStatusItem", description = "订单状态项")
    public static class OrderStatusItem {
        @ApiModelProperty(value = "状态名称")
        private String statusName;

        @ApiModelProperty(value = "状态值")
        private String statusValue;

        @ApiModelProperty(value = "订单数量")
        private Integer count;

        @ApiModelProperty(value = "占比")
        private BigDecimal percentage;
    }
}
